package com.example.xposed;

import android.location.LocationManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
import android.telephony.TelephonyManager;
import android.util.Log;

import com.example.xposed.hook.ActivityHook;
import com.example.xposed.hook.Hook;

import de.robv.android.xposed.IXposedHookInitPackageResources;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.callbacks.XC_InitPackageResources;
import de.robv.android.xposed.callbacks.XC_LoadPackage;

public class LocationHook implements IXposedHookLoadPackage, IXposedHookZygoteInit, IXposedHookInitPackageResources {
    public static final String TAG = "LocationHook";

    public static String packageName = "null";
    public static String processName = "null";

    @Override
    public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
        packageName = lpparam.packageName;
        processName = lpparam.processName;
        Log.e(TAG, "handleLoadPackage: pkg=" + packageName + " processName=" + packageName);
        if (BuildConfig.APPLICATION_ID.equals(packageName)) {
            return;
        }
        new ActivityHook().hook();
        UseGps.hkGPS(lpparam.classLoader);
//        new WeWork().start(lpparam.classLoader);


    }


    @Override
    public void handleInitPackageResources(XC_InitPackageResources.InitPackageResourcesParam resparam) throws Throwable {

    }


    @Override
    public void initZygote(StartupParam startupParam) throws Throwable {

    }
}
